﻿using System;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;

namespace _052_传递状态数据
{
    class Program
    {
        static void Main(string[] args)
        {

            var 二元组之于我 = (Name: "Jack", Age: 28);

            Task 任务pp = new Task(s =>
            {
                //读取状态数据
                (string name, int age) = ((string, int))s;
                Console.WriteLine($"Name:{name}\nAge:{age}"
                );
            }, 二元组之于我);


            //以下重载版本的构造函数支持输入状态数据
            //public Task(Action<object> action, object state);
            任务pp.Start();
            任务pp.Wait();


        }
    }
}
